﻿Imports System.ComponentModel
Imports System.Collections.ObjectModel

''' <summary>
''' 表示图的一条边
''' </summary>
''' <remarks></remarks>
Public Class Edge
    Inherits PropertyChangedBase

    Private _BeginNode As Node
    Public Property BeginNode As Node
        Get
            Return _BeginNode
        End Get
        Set(value As Node)
            _BeginNode = value
            OnPropertyChanged("BeginNode")
        End Set
    End Property

    Private _EndNode As Node
    Public Property EndNode As Node
        Get
            Return _EndNode
        End Get
        Set(value As Node)
            _EndNode = value
            OnPropertyChanged("EndNode")
        End Set
    End Property

    Private _Label As String
    Public Property Label As String
        Get
            Return _Label
        End Get
        Set(value As String)
            _Label = value
            OnPropertyChanged("Label")
        End Set
    End Property

    Public Overrides Function ToString() As String
        Return String.Format("""{0}"" -> ""{1}"" [color={2}];", BeginNode.Name, EndNode.Name, Label)
    End Function

End Class
